<template>
  <div>
    <a-form-model>
      <a-form-model-item label="内容">
        <a-input v-model="content" />
      </a-form-model-item>
      <a-form-model-item>
        <a-button type="primary" @click="addSbt">
          保存
        </a-button>
      </a-form-model-item>
    </a-form-model>
  </div>
</template>

<script>
export default {
  name: 'Add',
  data () {
    return {
      content: ''
    }
  },
  methods: {
    addSbt () {
      const content = this.content
      this.$axios.post('/api/list', { content }).then((res) => {
        this.$router.push({ path: '/' })
      })
    }
  }
}
</script>

<style scoped>

</style>
